package Sort;

public class Test implements Comparable<Object> {
	private Integer number;
	Test(int i) {
		number=i;
	}
	@Override
	public int compareTo(Object o) {
		return number.compareTo(((Test)o).number);
	}
	@Override
	public String toString() {
		return number.toString();
	}	
	public static void main(String[] args) {
	Integer[] a = new Integer[]{4,6,2,7,2,83,3};
	System.out.println("Unsorted array of integers");
	for(int i=0;i<a.length;i++) System.out.print(a[i]+" ");
	a=(Integer[]) Sort.QuickSort(a, 0, a.length-1);
	System.out.println();
	System.out.println("Sorted array of objects");
	for(int i=0;i<a.length;i++) System.out.print(a[i]+" ");
	System.out.println();
	Test[] b = new Test[]{new Test(4),new Test(6),new Test(2),new Test(7),new Test(2),new Test(83),new Test(3)};
	System.out.println("Unsorted array of objects");
	for(int i=0;i<b.length;i++) System.out.print(b[i]+" ");
	b=(Test[]) Sort.QuickSort(b, 0, b.length-1);
	System.out.println();
	System.out.println("Sorted array of objects");
	for(int i=0;i<b.length;i++) System.out.print(b[i]+" ");
	}
}